package org.wisdom.security.config;

import lombok.RequiredArgsConstructor;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.authentication.configuration.GlobalAuthenticationConfigurerAdapter;
import org.springframework.stereotype.Component;

/**
 * @author 张智研
 * @date 2022/09/15 15:05
 **/
@Component
@RequiredArgsConstructor
public class AuthenticationConfigurerAdapter extends GlobalAuthenticationConfigurerAdapter {

    private final TokenAuthenticationProvider tokenAuthenticationProvider;
    private final InsideAuthenticationProvider insideAuthenticationProvider;

    @Override
    public void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth.authenticationProvider(this.tokenAuthenticationProvider);
        auth.authenticationProvider(this.insideAuthenticationProvider);
    }
}
